/*
 * Copyright 2009 Armando Blancas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tests.taskgraph.tasks.io;

import java.math.BigDecimal;
import java.math.BigInteger;

import javax.persistence.Entity;

import taskgraph.reflect.Field;


/**
 * Sample class for testing all supported types for automated object
 * persistence in flat files.
 * 
 * <p>This class follows the Java Persistence API and thus it may be used for
 * automated persistence or retrieval of customer data from a SQL database
 * or a custom source, such as a flat file source task.
 * 
 * @author Armando Blancas
 * @see taskgraph.tasks.io.ReadDelimitedTextFile
 * @see taskgraph.tasks.io.WriteDelimitedTextFile
 */
@Entity
public class SupportedTypes {

	/**
	 * SupportedTypes class version number.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Instance variables declared in the order they appear in the flat file.
	 */
	private boolean booleanValue;
	private byte byteValue;
	private char charValue;
	private short shortValue;
	private int intValue;
	private long longValue;
	private float floatValue;
	private double doubleValue;
	
	private String stringValue;
	private BigInteger bigIntValue;
	private BigDecimal bigDecimalValue;
	private java.util.Date dateValue;
	private java.sql.Date sqlDateValue;
	private java.sql.Time timeValue;
	private java.sql.Timestamp tstampValue;

	private Boolean booleanWrapper;
	private Byte byteWrapper;
	private Character charWrapper;
	private Short shortWrapper;
	private Integer intWrapper;
	private Long longWrapper;
	private Float floatWrapper;
	private Double doubleWrapper;
	
	/**
	 * Default constructor.
	 */
	public SupportedTypes() {
		// do nothing
	}

	/**
	 * Creates a fully initialized instance.
	 * 
	 * @param booleanValue
	 * @param byteValue
	 * @param charValue
	 * @param shortValue
	 * @param intValue
	 * @param longValue
	 * @param floatValue
	 * @param doubleValue
	 * @param stringValue
	 * @param bigIntValue
	 * @param bigDecimalValue
	 * @param dateValue
	 * @param sqlDateValue
	 * @param timeValue
	 * @param tstampValue
	 * @param booleanWrapper
	 * @param byteWrapper
	 * @param charWrapper
	 * @param shortWrapper
	 * @param intWrapper
	 * @param longWrapper
	 * @param floatWrapper
	 * @param doubleWrapper
	 */
	public SupportedTypes(
		boolean booleanValue, byte byteValue, char charValue, short shortValue,
	    int intValue, long longValue, float floatValue, double doubleValue,
	    String stringValue, BigInteger bigIntValue, BigDecimal bigDecimalValue,
	    java.util.Date dateValue, java.sql.Date sqlDateValue,
	    java.sql.Time timeValue, java.sql.Timestamp tstampValue, 
	    Boolean booleanWrapper, Byte byteWrapper, Character charWrapper,
		Short shortWrapper, Integer intWrapper, Long longWrapper, 
		Float floatWrapper, Double doubleWrapper) {
		
		setBooleanValue(booleanValue);
		setByteValue(byteValue);
		setCharValue(charValue);
		setShortValue(shortValue);
		setIntValue(intValue);
		setLongValue(longValue);
		setFloatValue(floatValue);
		setDoubleValue(doubleValue);
		setStringValue(stringValue);
		setBigIntValue(bigIntValue);
		setBigDecimalValue(bigDecimalValue);
		setDateValue(dateValue);
		setSqlDateValue(sqlDateValue);
		setTimeValue(timeValue);
		setTstampValue(tstampValue);
		setBooleanWrapper(booleanWrapper);
		setByteWrapper(byteWrapper);
		setCharWrapper(charWrapper);
		setShortWrapper(shortWrapper);
		setIntWrapper(intWrapper);
		setLongWrapper(longWrapper);
		setFloatWrapper(floatWrapper);
		setDoubleWrapper(doubleWrapper);
	}
	
	/**
	 * @return the booleanValue
	 */
	@Field(position = 1)
	public boolean isBooleanValue() {
		return booleanValue;
	}
	
	/**
	 * @param booleanValue the booleanValue to set
	 */
	public void setBooleanValue(boolean booleanValue) {
		this.booleanValue = booleanValue;
	}
	
	/**
	 * @return the byteValue
	 */
	@Field(position = 2)
	public byte getByteValue() {
		return byteValue;
	}
	
	/**
	 * @param byteValue the byteValue to set
	 */
	public void setByteValue(byte byteValue) {
		this.byteValue = byteValue;
	}
	
	/**
	 * @return the charValue
	 */
	@Field(position = 3)
	public char getCharValue() {
		return charValue;
	}
	
	/**
	 * @param charValue the charValue to set
	 */
	public void setCharValue(char charValue) {
		this.charValue = charValue;
	}
	
	/**
	 * @return the shortValue
	 */
	@Field(position = 4)
	public short getShortValue() {
		return shortValue;
	}
	
	/**
	 * @param shortValue the shortValue to set
	 */
	public void setShortValue(short shortValue) {
		this.shortValue = shortValue;
	}
	
	/**
	 * @return the intValue
	 */
	@Field(position = 5)
	public int getIntValue() {
		return intValue;
	}
	
	/**
	 * @param intValue the intValue to set
	 */
	public void setIntValue(int intValue) {
		this.intValue = intValue;
	}
	
	/**
	 * @return the longValue
	 */
	@Field(position = 6)
	public long getLongValue() {
		return longValue;
	}
	
	/**
	 * @param longValue the longValue to set
	 */
	public void setLongValue(long longValue) {
		this.longValue = longValue;
	}
	
	/**
	 * @return the floatValue
	 */
	@Field(position = 7)
	public float getFloatValue() {
		return floatValue;
	}
	
	/**
	 * @param floatValue the floatValue to set
	 */
	public void setFloatValue(float floatValue) {
		this.floatValue = floatValue;
	}
	
	/**
	 * @return the doubleValue
	 */
	@Field(position = 8)
	public double getDoubleValue() {
		return doubleValue;
	}
	
	/**
	 * @param doubleValue the doubleValue to set
	 */
	public void setDoubleValue(double doubleValue) {
		this.doubleValue = doubleValue;
	}
	
	/**
	 * @return the stringValue
	 */
	@Field(position = 9)
	public String getStringValue() {
		return stringValue;
	}
	
	/**
	 * @param stringValue the stringValue to set
	 */
	public void setStringValue(String stringValue) {
		this.stringValue = stringValue;
	}
	
	/**
	 * @return the bigIntValue
	 */
	@Field(position = 10)
	public BigInteger getBigIntValue() {
		return bigIntValue;
	}
	
	/**
	 * @param bigIntValue the bigIntValue to set
	 */
	public void setBigIntValue(BigInteger bigIntValue) {
		this.bigIntValue = bigIntValue;
	}
	
	/**
	 * @return the bigDecimalValue
	 */
	@Field(position = 11)
	public BigDecimal getBigDecimalValue() {
		return bigDecimalValue;
	}
	
	/**
	 * @param bigDecimalValue the bigDecimalValue to set
	 */
	public void setBigDecimalValue(BigDecimal bigDecimalValue) {
		this.bigDecimalValue = bigDecimalValue;
	}
	
	/**
	 * @return the dateValue
	 */
	@Field(position = 12)
	public java.util.Date getDateValue() {
		return dateValue;
	}
	
	/**
	 * @param dateValue the dateValue to set
	 */
	public void setDateValue(java.util.Date dateValue) {
		this.dateValue = dateValue;
	}
	
	/**
	 * @return the sqlDateValue
	 */
	@Field(position = 13)
	public java.sql.Date getSqlDateValue() {
		return sqlDateValue;
	}
	
	/**
	 * @param sqlDateValue the sqlDateValue to set
	 */
	public void setSqlDateValue(java.sql.Date sqlDateValue) {
		this.sqlDateValue = sqlDateValue;
	}
	
	/**
	 * @return the timeValue
	 */
	@Field(position = 14)
	public java.sql.Time getTimeValue() {
		return timeValue;
	}
	
	/**
	 * @param timeValue the timeValue to set
	 */
	public void setTimeValue(java.sql.Time timeValue) {
		this.timeValue = timeValue;
	}
	
	/**
	 * @return the tstampValue
	 */
	@Field(position = 15)
	public java.sql.Timestamp getTstampValue() {
		return tstampValue;
	}
	
	/**
	 * @param tstampValue the tstampValue to set
	 */
	public void setTstampValue(java.sql.Timestamp tstampValue) {
		this.tstampValue = tstampValue;
	}

	/**
	 * @return the booleanWrapper
	 */
	@Field(position = 16)
	public Boolean getBooleanWrapper() {
		return booleanWrapper;
	}

	/**
	 * @param booleanWrapper the booleanWrapper to set
	 */
	public void setBooleanWrapper(Boolean booleanWrapper) {
		this.booleanWrapper = booleanWrapper;
	}

	/**
	 * @return the byteWrapper
	 */
	@Field(position = 17)
	public Byte getByteWrapper() {
		return byteWrapper;
	}

	/**
	 * @param byteWrapper the byteWrapper to set
	 */
	public void setByteWrapper(Byte byteWrapper) {
		this.byteWrapper = byteWrapper;
	}

	/**
	 * @return the charWrapper
	 */
	@Field(position = 18)
	public Character getCharWrapper() {
		return charWrapper;
	}

	/**
	 * @param charWrapper the charWrapper to set
	 */
	public void setCharWrapper(Character charWrapper) {
		this.charWrapper = charWrapper;
	}

	/**
	 * @return the shortWrapper
	 */
	@Field(position = 19)
	public Short getShortWrapper() {
		return shortWrapper;
	}

	/**
	 * @param shortWrapper the shortWrapper to set
	 */
	public void setShortWrapper(Short shortWrapper) {
		this.shortWrapper = shortWrapper;
	}

	/**
	 * @return the intWrapper
	 */
	@Field(position = 20)
	public Integer getIntWrapper() {
		return intWrapper;
	}

	/**
	 * @param intWrapper the intWrapper to set
	 */
	public void setIntWrapper(Integer intWrapper) {
		this.intWrapper = intWrapper;
	}

	/**
	 * @return the longWrapper
	 */
	@Field(position = 21)
	public Long getLongWrapper() {
		return longWrapper;
	}

	/**
	 * @param longWrapper the longWrapper to set
	 */
	public void setLongWrapper(Long longWrapper) {
		this.longWrapper = longWrapper;
	}

	/**
	 * @return the floatWrapper
	 */
	@Field(position = 22)
	public Float getFloatWrapper() {
		return floatWrapper;
	}

	/**
	 * @param floatWrapper the floatWrapper to set
	 */
	public void setFloatWrapper(Float floatWrapper) {
		this.floatWrapper = floatWrapper;
	}

	/**
	 * @return the doubleWrapper
	 */
	@Field(position = 23)
	public Double getDoubleWrapper() {
		return doubleWrapper;
	}

	/**
	 * @param doubleWrapper the doubleWrapper to set
	 */
	public void setDoubleWrapper(Double doubleWrapper) {
		this.doubleWrapper = doubleWrapper;
	}

}
